﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Entities;
using Bussiness;
using NUnit.Framework;
namespace TestApplication
{
    /// <summary>
    /// This class is used to test class CaculatesSomethings
    /// </summary>
    [TestFixture]
    [Category("TestDispenseMoney")]
    public class Test_DispenseMoney
    {
        AtmSystem atmsystem = new AtmSystem();
        int fiftynotes;
        int twentynotes;
        float amount;

        [Test]
        public void TestSuccessfulWithdrawal_MoneyNotesIsValid()
        {
            MoneyDispenserBLL moneyDispenserbll = new MoneyDispenserBLL();
            fiftynotes = 1000;
            twentynotes = 1000;
            bool expected = true;
            bool actual = moneyDispenserbll.SuccessfulWithdrawal(fiftynotes, twentynotes, atmsystem);
            Assert.AreEqual(expected, actual);
        }

        [Test]
        public void TestSuccessfulWithdrawal_MoneyNotesInValid()
        {
            MoneyDispenserBLL moneyDispenserbll = new MoneyDispenserBLL();
            fiftynotes = 3000;
            twentynotes = 6000;
            bool expected = false;
            bool actual = moneyDispenserbll.SuccessfulWithdrawal(fiftynotes, twentynotes, atmsystem);
            Assert.AreEqual(expected, actual);
        }

        [Test]
        public void TestSuccessfulWithdrawal_fiftyNotesInValid()
        {
            MoneyDispenserBLL moneyDispenserbll = new MoneyDispenserBLL();
            fiftynotes = 3000;
            twentynotes = 1000;
            bool expected = false;
            bool actual = moneyDispenserbll.SuccessfulWithdrawal(fiftynotes, twentynotes, atmsystem);
            Assert.AreEqual(expected, actual);
        }

        [Test]
        public void TestSuccessfulWithdrawal_twentyNotesInValid()
        {
            MoneyDispenserBLL moneyDispenserbll = new MoneyDispenserBLL();
            fiftynotes = 1000;
            twentynotes = 6000;
            bool expected = false;
            bool actual = moneyDispenserbll.SuccessfulWithdrawal(fiftynotes, twentynotes, atmsystem);
            Assert.AreEqual(expected, actual);
        }

        [Test]
        public void DispenseMoney_AmountIsNegative()
        {
            MoneyDispenserBLL moneyDispenserbll = new MoneyDispenserBLL();
            amount = -1;
            bool expected = false;
            bool actual = moneyDispenserbll.DispenseMoney(amount);
            Assert.AreEqual(expected, actual);
        }

        [Test]
        public void DispenseMoney_AmountIsZero()
        {
            MoneyDispenserBLL moneyDispenserbll = new MoneyDispenserBLL();
            amount = 0;
            bool expected = false;
            bool actual = moneyDispenserbll.DispenseMoney(amount);
            Assert.AreEqual(expected, actual);
        }

        [Test]
        public void DispenseMoney_AmountIsLess50K()
        {
            MoneyDispenserBLL moneyDispenserbll = new MoneyDispenserBLL();
            amount = 40;
            bool expected = false;
            bool actual = moneyDispenserbll.DispenseMoney(amount);
            Assert.AreEqual(expected, actual);
        }

        [Test]
        public void DispenseMoney_AmountIsEqual50K()
        {
            MoneyDispenserBLL moneyDispenserbll = new MoneyDispenserBLL();
            amount = 50;
            bool expected = true;
            bool actual = moneyDispenserbll.DispenseMoney(amount);
            Assert.AreEqual(expected, actual);
        }

        [Test]
        public void DispenseMoney_AmountIsValid()
        {
            MoneyDispenserBLL moneyDispenserbll = new MoneyDispenserBLL();
            amount = 1000;
            bool expected = true;
            bool actual = moneyDispenserbll.DispenseMoney(amount);
            Assert.AreEqual(expected, actual);
        }
    }
}
